<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>三级推广配置文件管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		//打开奖品详情
		function open(oid){
			top.$.jBox.open("iframe:${ctx}/wechat/lottery/expandLotteryList?sourceId="+oid+"&sourceType=3&type=7", "奖品详情",
			$(top.document).width()-220,$(top.document).height()-180,{
				
				buttons:{"确定":true}, loaded:function(h){
					$(".jbox-content", top.document).css("overflow-y","hidden");
				}
			});
		}
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/wechat/recommendConfig/">三级推广配置文件列表</a></li>
		<shiro:hasPermission name="wechat:recommendConfig:edit"><li><a href="${ctx}/wechat/recommendConfig/form">三级推广配置文件添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="recommendConfig" action="${ctx}/wechat/recommendConfig/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
			<th>名称</th><th>是否开启</th><th>类型</th><th>开始时间</th><th>结束时间</th>
		<shiro:hasPermission name="wechat:recommendConfig:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="recommendConfig">
			<tr>
				<td><a href="${ctx}/wechat/recommendConfig/form?id=${recommendConfig.id}">${recommendConfig.name}</a></td>
				<td>
					<c:if test="${recommendConfig.isOpen eq '0'}">未开启</c:if>
					<c:if test="${recommendConfig.isOpen eq '1'}">已开启</c:if>
				</td>
				<td>
					<c:if test="${recommendConfig.type eq '0'}">得积分兑奖品</c:if>
					<c:if test="${recommendConfig.type eq '1'}">积分排名送奖品</c:if>
				</td>
				
				<td><fmt:formatDate value="${recommendConfig.startTime}" type="both"/></td>
				<td><fmt:formatDate value="${recommendConfig.endTime}" type="both"/></td>
				
				<shiro:hasPermission name="wechat:recommendConfig:edit"><td>
					<%-- <a class="btn btn-primary" href="${ctx}/wechat/lottery/expandLotteryList?sourceId=${recommendConfig.id}&sourceType=3&type=7">三级推广奖品</a> --%>
    				<a class="btn btn-primary" href="javascript:open(${recommendConfig.id})" >查看商品</a>
    				
    				<c:if test="${recommendConfig.isOpen eq '0'}"><a class="btn btn-success" href="${ctx}/wechat/recommendConfig/openConfig?id=${recommendConfig.id}">开启</a></c:if>
					<c:if test="${recommendConfig.isOpen eq '1'}"><a class="btn btn-danger" href="${ctx}/wechat/recommendConfig/closeConfig?id=${recommendConfig.id}">关闭</a></c:if>
    				
    				
    				<a class="btn btn-success" href="${ctx}/wechat/recommendConfig/form?id=${recommendConfig.id}">修改</a>
					<a class="btn btn-danger" href="${ctx}/wechat/recommendConfig/delete?id=${recommendConfig.id}" onclick="return confirmx('确认要删除该三级推广配置文件吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
